package com.nus.servlets;


import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

/**
 * Created by IntelliJ IDEA.
 * User: dell
 * Date: 9/20/12
 * Time: 10:57 PM
 * To change this template use File | Settings | File Templates.
 */
public class LogoutServlet extends  AbstractServlet{

    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        doPost(request, response);
    }
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        HttpSession session  = request.getSession();
        session.invalidate();
        response.sendRedirect("index.jsp");


    }



}
